package com.region.http.client.request;

import com.region.core.annotation.Region;
import com.region.http.client.annotation.request.GetUrl;
import com.region.http.client.annotation.parameter.ParamKey;
import com.region.http.client.annotation.request.PostUrl;
import com.region.http.client.common.ContentType;
import com.region.http.client.entity.ResultVO;

import java.io.File;
import java.io.InputStream;
import java.util.Map;

@Region(value = "https://127.0.0.1:9999/springmvc")
public interface FileRequest {

    @GetUrl(value = "/file/downLoadFile")
    byte[] downLoadFileWithBytes();

    @GetUrl(value = "/file/downLoadFile")
    File downLoadFileWithFile();

    @GetUrl(value = "/file/downLoadFile")
    InputStream downLoadFileWithInputStream();

    @PostUrl(value = "/file/uploadFile", contentType = ContentType.MULTIPART_FORM_DATA_VALUE)
    ResultVO<Map<String, Object>> uploadFile(@ParamKey("file") File file);

    @PostUrl(value = "/file/uploadFile", contentType = ContentType.MULTIPART_FORM_DATA_VALUE)
    ResultVO<Map<String, Object>> uploadFile(@ParamKey("file")InputStream stream);

    @PostUrl(value = "/file/uploadFiles", contentType = ContentType.MULTIPART_FORM_DATA_VALUE)
    ResultVO<Map<String, Object>> uploadFiles(@ParamKey("files") File[] files, @ParamKey("other") String data);

}
